//
//  RecT5Cell.m
//  HeartTravel
//
//  Created by dlios on 15-6-30.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "RecT5Cell.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation RecT5Cell
-(void)dealloc{
    [_backView release];
    [_contentLabel release];
    [_nameLabel release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatData];
    }
    return self;
    
}
-(void)creatData{
    self.backView=[[UIImageView alloc]init];
    [self.contentView addSubview:self.backView];
    [self.backView release];
    
    self.nameLabel =[[UILabel alloc]init];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel release];
    
    self.contentLabel=[[UILabel alloc]init];
    [self.contentView addSubview:self.contentLabel];
    [self.contentLabel release];
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.backView.frame=CGRectMake(5, 5, WIDTH-10, HEIGHT-5);
    
    self.nameLabel.frame=CGRectMake(0, (2*HEIGHT-5)/5, WIDTH-10, HEIGHT/5);
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    self.nameLabel.font=[UIFont boldSystemFontOfSize:25];
    self.nameLabel.textColor=[UIColor whiteColor];
    self.nameLabel.shadowOffset=CGSizeMake(2, 2);
    self.nameLabel.shadowColor=[UIColor grayColor];
    
    self.contentLabel.frame=CGRectMake(0, 3*(HEIGHT-5)/5, WIDTH-10, 20);
    self.contentLabel.textAlignment = NSTextAlignmentCenter;
    self.contentLabel.font=[UIFont boldSystemFontOfSize:12];
    self.contentLabel.textColor=[UIColor whiteColor];
}
- (void)awakeFromNib {
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
